<template>
  <el-container
      class="layout-container-demo"
      style="height: 525px; border: 2px solid #eee"
  >
    <el-aside width="150px" style="background-color: rgb(238, 241, 246)">
      <AsideMenu/>
    </el-aside>
    <el-container>
      <!--      <el-header style="text-align: right; font-size: 12px">-->
      <!--        <HeaderBar/>-->
      <!--      </el-header>-->
      <el-main>
        <!-- <MainContainer/> -->
        <!-- 显示路由组件 -->
        <router-view v-if="isRouterAlive"/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// import HelloWorld from './components/HelloWorld.vue'
import AsideMenu from "./components/index/AsideMenu.vue";
// import HeaderBar from "./components/index/HeaderBar.vue";
// import MainContainer from "./components/index/MainContainer.vue";

export default {
  name: "App",
  components: {
    // HelloWorld
    AsideMenu,
    // HeaderBar,
    // MainContainer
  },
  provide() {
    return {
      reload: this.reload,
    }
  },
  data() {
    return {
      isRouterAlive: true
    }
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      })
    },
  }
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  /* margin-top: 60px; */
}

.layout-container-demo .el-header {
  position: relative;
  background-color: #b3c0d1;
  color: var(--el-text-color-primary);
}

.layout-container-demo .el-aside {
  width: 210px;
  color: var(--el-text-color-primary);
  background: #fff !important;
  border-right: solid 1px #e6e6e6;
  box-sizing: border-box;
}

.layout-container-demo .el-main {
  padding: 0;
}

.layout-container-demo .toolbar {
  position: absolute;
  display: inline-flex;
  align-items: center;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
}
</style>
